package com.imeem.api.data;

import java.net.MalformedURLException;
import java.net.URL;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;

public abstract class MediaData
{ 
   private String _id;
   public String getId() { return _id; }
   public void setId(String id) { _id = id; }
   
   public abstract String getType();
   
   private URL _url;
   public URL getURL() { return _url; }
   public void setURL(String url) throws MalformedURLException
   {
      _url = new URL(url);
   }
   
   private String _title;
   public String getTitle() { return _title; }
   public void setTitle(String title) { _title = title; }
   
   private String _postedBy;
   public String getPostedBy() { return _postedBy; }
   public void setPostedBy(String postedBy) { _postedBy = postedBy; }
   
   private URL _postedByUrl;
   public URL getPostedByURL() { return _postedByUrl; }
   public void setPostedByURL(String postedByUrl) throws MalformedURLException
   {
      _postedByUrl = new URL(postedByUrl);
   }

   private String _postedById;
   public String getPostedById() { return _postedById; }
   public void setPostedById(String id) { _postedById = id; }

   private int _viewCount;
   public int getViewCount() { return _viewCount; }
   public void setViewCount(int count) { _viewCount = count; }
   
   private int _favoriteCount;
   public int getFavoriteCount() { return _favoriteCount; }
   public void setFavoriteCount(int count) { _favoriteCount = count; }
   
   private int _commentCount;
   public int getCommentCount() { return _commentCount; }
   public void setCommentCount(int count) { _commentCount = count; }
   
   private Date _createDate;
   public Date getCreateDate() { return _createDate; }
   public void setCreateDate(String date) throws ParseException
   {
      _createDate = DateFormat.getInstance().parse(date);
   }
}
